﻿using System;
using System.Collections.Generic;

namespace VisionCloud.Domain.Common
{
    public class HeartPkgResp : ApiRespBase<HeartPkgRespData>
    {
        public HeartPkgResp(HeartCode heartCode)
        {
            base.Code = (int)heartCode;
            this.Data = new HeartPkgRespData();
        }

        public HeartPkgResp(HeartCode heartCode, string message)
        {
            base.Code = (int)heartCode;
            base.Message = message;
            this.Data = new HeartPkgRespData();
        }

        [Flags]
        public enum HeartCode
        {
            Normal = 0,
            UnRegister = 1 << 0,
            UpdatePkg = 1 << 1,
            AlgPkg = 1 << 2,
            DevicePkg = 1 << 3,
        }
    }

    public class HeartPkgRespData
    {
        public Pkg updatePkg { get; set; }

        public List<Pkg> algPkgs { get; set; } = new List<Pkg>();

        public List<Pkg> devicePkgs { get; set; } = new List<Pkg>();
    }

    public class Pkg
    {
        public string name { get; set; }

        public string path { get; set; }

        public string version { get; set; }

        public string minUpdatePkgVersion { get; set; }

        public bool EnableAutoUpdate { get; set; }
    }
}